package handler

import (
	"strconv"
	"web_framework/model"
	"web_framework/pkg/e"
	"web_framework/storage"
	"web_framework/pkg/constvar"
)

// 推送 速度限制 队列响应接口
type SetLimitSpeedHandle struct {
}

func (setLimitSpeedHandle SetLimitSpeedHandle) handleMsg(data model.Request, sn string) (result model.Response) {
	// 缓存标记状态
	setLimitSpeedCacheKey := constvar.RouterRedisPrefix + sn + storage.RedisSetLimitSpeedMidCacheKey + ":" + strconv.Itoa(data.Mid)
	if  storage.RedisExists(setLimitSpeedCacheKey){

		if bool,_ := storage.RedisSet(setLimitSpeedCacheKey, 0 , 20);bool == false{
			e.Log("Info", "更新速度限制缓存标记失败")

		}
	}

	return model.Response{}
}